﻿using System.Runtime.Serialization;
using CID.Domain.Development;

namespace CID.Execution.Support.Information
{
    [DataContract]
    public class VersionInfo
    {
        protected VersionInfo() { }

        public VersionInfo(IVersion version)
        {
            Id = version.Id;
            Component = new ComponentInfo(version.Component);
            Name = version.Name;
        }

        [DataMember]
        public int Id { get; set; }

        [DataMember]
        public ComponentInfo Component { get; set; }

        [DataMember]
        public string Name { get; set; }

        internal VersionInfo Clone()
        {
            return new VersionInfo() { Id = Id, Name = Name, Component = Component.Clone() };
        }
    }
}
